/**
 * 关联tb任务区块
 */

import React from 'react';
import track from 'utils/track';
import AssociatePanel from '@alife/yunxiao-create-mr-associate';
import { getFeature } from 'utils/features';
export default class UILessAssociateTask extends React.Component {
  render() {
    const { useBy } = this.props;
    if (!getFeature('project.associated_projex_workitem')) {
      return null;
    }
    return (
      <AssociatePanel
        plugin={{ type: 'codeup-task', tbHost: window.UILessConfig.tbHost }}
        container={{
          type: 'task',
          target: 'merge_request',
          // 任务中新建MR，传当前taskId
          // id: this.props.associateId,
        }}
        style={{ width: '100%' }}
        uiless_config={{
          ...window.UILessConfig,
          codeupTrack: track,
          useBy,
        }}
        {...this.props}
      />
    );
  }
}
